﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WordGame.Question;

namespace WordGame.Answer
{
    class Bob : IWordGame
    {
        public int getCheater(string[] first, string[] second, string[] third)
        {
            try
            {
                for (int i = 0; i < first.Length; i++)
                {
                    if (!(second[i].Length - first[i].Length == 1) && !second[i].StartsWith(first[i]) && !second[i].EndsWith(first[i]))
                    {
                        return 1;
                    }

                    if (!(third[i].Length - second[i].Length == 1) && !third[i].StartsWith(second[i]) && !third[i].EndsWith(second[i]))
                    {
                        return 2;
                    }

                    if (i > 0)
                    {

                        if (!(first[i].Length - third[i - 1].Length == 1) && !first[i].StartsWith(third[i - 1]) && !first[i].EndsWith(third[i - 1]))
                        {
                            return 3;
                        }

                    }

                }
            }
            catch
            {
            }
            return -1;

        }
    }
}
